<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>奇怪的东西</title>
</head>
<body>
    <h3>欢迎访问奇怪的东西！</h3>
    <input type="file" name="file">
    <button id="submit">上传</button><br>
    <button id="startUp">启动</button>
</body>
<script src="/js/jquery.min.js"></script>
<script>
    //上传
    $("#submit").click(function(){
        var formData = new FormData();
        formData.append("file",$("[name='file']")[0].files[0]);
        $.ajax({
            url: "/upload",
            processData: false,
            contentType: false,
            data: formData,
            type: "POST",
            success: function (result) {
                if(result.status == 200){
                    alert("上传成功！")
                }
            }
        });
    });
    //启动
    $("#startUp").click(function(){
        $.ajax({
            url: "/startUp",
            type: "GET",
            success: function (result) {
                if(result.status == 200){
                    alert("启动成功！")
                }
            }
        });
    });
</script>
</html>